import Vue from 'vue'
import {createRouter,createWebHashHistory} from 'vue-router'

import Login from '@/components/Login.vue'
import MainPage from '@/components/MainPage.vue'
import Registor from '@/components/Registor.vue'
import Admin from '../components/Admin.vue'

//Vue.useAttrs(VueRouter)
const webHistory = createWebHashHistory()

const router = createRouter({
    history: webHistory,
    routes: [
        {path:'/',redirect:'/login'},
        {path:'/login',component: Login},
        {path:'/mainPage',component: MainPage},
        {path:'/registor',component: Registor},
        {path:'/admin',component: Admin}
    ],
})

export default router//向外共享路由对象